using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Pub_Module_HeaderMenu : System.Web.UI.UserControl
{
    public Orientation Orien = Orientation.Horizontal;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindData();
        }
    }
    public Orientation SetOrientation
    {
        get
        {
            return Orien;
        }
        set
        {
            Orien = value;
        }
    }


    protected override void AddedControl(Control control, int index)
    {
        if (Request.ServerVariables["http_user_agent"].IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) != -1)
        {
            this.Page.ClientTarget = "uplevel";
        }
        base.AddedControl(control, index);
    }


    private void BindData()
    {
        mnVertical.Orientation = Orien;
        clsWebShop cls = new clsWebShop();
        DataSet ds = new DataSet();

        DataTable dt = new DataTable();

        ds = cls.Get_Menu_HomeNoneProc();
        dt = ds.Tables[0];


        string TopicID, TopicName, CatID, CatName;
        foreach (DataRow row in dt.Rows)
        {
            MenuItem item = new MenuItem();
            string MenuName = row["MenuName"].ToString();
            string MenuURL = row["MenuURL"].ToString();
            item.Text = MenuName;
            item.NavigateUrl = MenuURL;
            //item.SeparatorImageUrl = "~/Images/Body/separatormenu.jpg";
            mnVertical.Items.Add(item);
        }

    }
}